Add SYCL support for geometry and pipelines kernels, Transform ops, Nearest neighbor search and HashMap - #7443
Merged
Merged
Conversation
|
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
… Registration, RGBDOdometry, TransformationConverter Co-authored-by: ssheorey <41028320+ssheorey@users.noreply.github.com>
…L declaration Co-authored-by: ssheorey <41028320+ssheorey@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add equivalent SYCL kernels for existing CUDA kernels
Add SYCL kernels for t/pipelines: Feature, FillInLinearSystem, Registration, RGBDOdometry, TransformationConverter
Feb 20, 2026
… to SYCL kernel files Co-authored-by: ssheorey <41028320+ssheorey@users.noreply.github.com>
Copilot
AI
changed the title
Add SYCL kernels for t/pipelines: Feature, FillInLinearSystem, Registration, RGBDOdometry, TransformationConverter
Add SYCL kernels for t/pipelines/kernel (Feature, FillInLinearSystem, Registration, RGBDOdometry, TransformationConverter)
Feb 23, 2026
…e coverage Co-authored-by: ssheorey <41028320+ssheorey@users.noreply.github.com>
Copilot
AI
changed the title
Add SYCL kernels for t/pipelines/kernel (Feature, FillInLinearSystem, Registration, RGBDOdometry, TransformationConverter)
Add SYCL kernels for t/pipelines (Feature, FillInLinearSystem, Registration, RGBDOdometry, TransformationConverter) and enable SYCL test coverage
Mar 13, 2026
…ead of plain global atomics Co-authored-by: ssheorey <41028320+ssheorey@users.noreply.github.com>
Copilot
AI
changed the title
Add SYCL kernels for t/pipelines (Feature, FillInLinearSystem, Registration, RGBDOdometry, TransformationConverter) and enable SYCL test coverage
Optimize SYCL pipeline kernels: group reduction instead of plain global atomics
Mar 13, 2026
Copilot
AI
changed the title
Optimize SYCL pipeline kernels: group reduction instead of plain global atomics
Add SYCL support for NNS-dependent operations via CPU fallback
Mar 14, 2026
SYCL nearest-neighbor search - Refactor tiled KNN/radius/hybrid into KnnSearchOpsSYCL.cpp + KnnSearchSYCLImpl.h so AddMM stays in the driver while top-K, count, and gather kernels are reusable and documented (small-k fused heap path vs legacy select/merge for large k). - Add configurable tile_bytes on KnnIndex/FixedRadiusIndex (defaults in NeighborSearchCommon.h) because integrated vs discrete Intel GPUs need different distance-tile sizes to stay cache-friendly without blowing memory. - Implement fused UpdateTopKFromTile for k ≤ 512, per-query threshold handling for radius/hybrid (radius² − |q|²), and finalize/clamp rules (C1/C4) so distances are non-negative and ties break by index like CPU/CUDA. - Extend C++/Python SYCL NNS tests (parity, coincident query, tie-break, radius, hybrid) to lock in correctness after the algorithm rewrite. SYCL hash map backend - Pack slot state, buf_index, and fingerprint into one uint64 per bucket to cut probe traffic and skip key-buffer loads on fingerprint mismatch. - Use power-of-two buckets with HashMix (fmix64) so probing uses masks instead of 64-bit modulo on GPU, and reserve/rehash when tombstones fill the table (GetNonEmptyCount + HashMap::Insert/Activate checks), not only live size. - Harden Insert for Intel Xe L1 coherence (seq_cst fences, LOCKED slots, restart-on-LOCKED instead of subgroup spin) to avoid stale keys and hangs. - Vectorize value copies via SYCLBlockCopyDispatch; improve GetActiveIndices with work-group scan + one atomic per group instead of per-slot atomics. - SYCLHashDeviceLookup uses plain loads when the table is read-only during raycast-style kernels. Core SYCL utilities - Add SYCLBlockCopyDispatch.h and use it in CopySYCL for object dtypes so copies use wide vector loads/stores instead of per-element queue.memcpy. Build and tooling (SYCL-without-CUDA / local dev) - Gate OPEN3D_CUDA_COMPILER_* defines and CompilerInfo CUDA strings on BUILD_CUDA_MODULE so SYCL-only builds do not reference undefined CUDA macros. - Add ENABLE_SANITIZER CMake option and wire -fsanitize into Open3D when set. - Comment out optional EGL/X11 linking block in cpp/open3d/CMakeLists.txt (local build adjustment—confirm this is intended before upstreaming).
Some optimizations. (e.g. restrict) lock free hashmap insert: write buffer then CAS design is correct and fast, but leaves holes in the data buffer. Center data before Knn, if using expanded L2 distance formula (p^2+q^2-2pq) to prevent cancellation bug in indexer: TensorIterator::GetPtr() incorrect for non-contiguous. Added Knn search benchmark
- SYCLContext: process-wide static singleton (was thread_local) to avoid per-thread SYCL contexts/USM mismatches; cache all device properties in one place (SYCLContext::Impl) and expose via GetDeviceProperties(). - Add SYCL launch helpers (SYCLPreferredWorkGroupSize, SYCLNdRange1D, group-reduction helpers) and use nd_range<1> + sycl::reduce_over_group across ParallelFor, elementwise, and reduction kernels instead of flat parallel_for(n) / per-output kernel launches. - ReductionSYCL: on-device GetInputPtrDevice() enables one kernel with one work-group per output for multi-output reductions (incl. arg-reductions). - Registration/RGBD odometry/SLAC kernels: accumulate AtA/Atb/residual in SLM per work-group (restrict-qualified pointers) instead of global atomics. - Rename SYCLBlockCopyDispatch.h -> BlockCopyDispatch.h, generalize the vectorized object-copy dispatch (up to 64-byte blocks) shared by the hash map and tensor copy paths; align CUDA hashmap Dispatch.h divisors to match. - Build: set -fsycl-max-parallel-link-jobs, prefer lld linker when available. - Update ParallelFor/Reduction benchmarks and Linalg/Tensor tests for the refactored SYCLContext API.
Add core::sy::IsCPUDevice() to detect the SYCL CPU fallback device and use it to throw clear errors from LeastSquaresSYCL (gels_batch), the SYCL hash map, and FixedRadiusSearch/HybridSearch, which are broken on SYCL CPU. Skip the corresponding C++ tests (HashMap, NNS, VoxelBlockGrid, Registration, Feature, PointCloud) and opt affected Python tests out of the SYCL CPU fallback via list_devices(also_sycl_cpu=False).
ssheorey
marked this pull request as ready for review
July 7, 2026 06:59
…e formatting - Guard IntegrateFrames() with #ifdef BUILD_SYCL_MODULE in cpp/tests/t/geometry/VoxelBlockGrid.cpp since it is only used by SYCL-gated tests, fixing unused-function-as-error in non-SYCL builds. - Apply repo clang-format/yapf style fixes to files touched by this PR.
- SYCL CPU fallback: Restored IsCPUDevice guards for FixedRadiusSearch and HybridSearch (and their dependent modules: NearestNeighborSearch, PointCloud, Registration, Feature) due to large-scale segmentation faults on SYCL CPU. HashMap and VoxelBlockGrid are now fully supported on SYCL CPU. - MSVC preprocessor: Fixed compilation error in PointCloudImpl.h by replacing nested #if/#elif inside lambda with OPEN3D_ATOMIC_ADD. - CUDA compilation: Resolved BlockCopy64 template argument error in SlabHashBackend/StdGPUHashBackend by moving struct to namespace scope, and brought global isnan into trianglemesh namespace. - Benchmarks: Explicitly linked Open3D::3rdparty_sycl to benchmarks target to resolve DSO link errors. - Tests: Updated Python and C++ test suites to run cleanly with ONEAPI_DEVICE_SELECTOR=opencl:cpu and when SYCL is disabled. Co-authored-by: Cursor <cursoragent@cursor.com>
… make CMake link options private This prevents runtime crashes on CPU devices, improves performance by caching contiguity, and avoids propagating build-time options to downstream consumers. Co-authored-by: Cursor <cursoragent@cursor.com>
This cleans up the PR's diff and ensures compliance with the CI's style-checking rules. Co-authored-by: Cursor <cursoragent@cursor.com>
…brid NNS Replace the O(N*M) tiled-AddMM brute force in FixedRadiusSearchSYCL and HybridSearchSYCL with a shared spatial-hash CSR grid (cell size 2*radius), mirroring CUDA's FixedRadiusSearchImpl.cuh: count -> oneDPL inclusive_scan -> scatter to build the grid, then a two-pass count/gather (radius) or single-pass top-max_knn (hybrid) over the 8 corner-adjacent hash bins per query. sort=true uses an on-device oneDPL sort_by_key (packed uint64 radix key for float, struct key + comparator for double). This also removes the SYCL-CPU restriction for FixedRadius/Hybrid search, since the grid algorithm (unlike the old AddMM path) has no GPU-specific sizing dependency; verified by unskipping and passing the previously CPU-guarded C++/Python parity tests, plus EstimateNormals/ RemoveRadiusOutliers end-to-end on SYCL:0 CPU fallback. Co-authored-by: Cursor <cursoragent@cursor.com>
…ign note Fixes the style-check CI failure (line-wrapping only, no logic changes). Also adds docs/cuda_vs_sycl_nns_hashmap.md summarizing how the SYCL and CUDA core::nns/core::HashMap implementations compare after the fixed-radius/hybrid grid port. Co-authored-by: Cursor <cursoragent@cursor.com>
Pre-reserve one heap slot per insert thread on the host (CUDA SlabHash-style) and DeviceFree slots that lose the CAS or hit a duplicate; avoids in-kernel Allocate/Free races.
RaycastingScene: dedupe ray-triangle hits by (geomID, tfar) instead of (geomID, primID, tfar), since Embree's SYCL/GPU filter callback does not reliably refresh primID across successive candidate hits for one ray, causing genuinely distinct intersections to be dropped. ParallelFor: guard the non-vectorized overload with device.IsSYCL() before dispatching to ParallelForSYCL_, matching the vectorized overload, so CPU devices don't crash when called from a SYCL-compiled translation unit. Also includes prior fixes from this session: SYCL reduction_prod tree reduction, KnnSearchSYCL large-k distance clamping, a TensorFunction tail-call stack-unwinding crash, and enabling SYCL devices by default in Python test parametrization. Co-authored-by: Cursor <cursoragent@cursor.com>
…l-kernels-for-cuda
Consolidate shared registration/transform/feature logic, SYCLUtils helpers, and hashmap buf_indices handling; expand in-source NNS/hash documentation and refresh C++/Python SYCL tests (drop redundant voxel block grid Python test). Co-authored-by: Cursor <cursoragent@cursor.com>
Guard ComputeRtPointToPointTensor when neither CUDA nor SYCL is built; apply style; skip SYCL-only C4 tie-break on CUDA; defer Windows SYCL VoxelBlockGrid golden tests; add CHANGELOG entry for SYCL tensor backends. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
ssheorey
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port missing CUDA kernels to SYCL and fix all "Unimplemented device" errors for SYCL tensors in the
t/pipelinesandt/geometrysubsystems.Type
Motivation and Context
SYCL:0devices hitutility::LogError("Unimplemented device")in several hot paths:Transform{Points,Normals}/Rotate{Points,Normals}— no SYCL dispatch inTransform.cppEstimateNormals,EstimateColorGradients,RemoveRadiusOutliers,RemoveStatisticalOutliers,ComputeBoundaryPoints—NearestNeighborSearchasserts non-SYCLt/pipelines/kernelfunctions (ComputeFPFHFeature,ComputePosePoint*,FillInLinearSystem,RGBDOdometry,TransformationConverter) — no SYCL kernels existedChecklist:
python util/check_style.py --applyto apply Open3D code styleto my code.
updated accordingly.
results (e.g. screenshots or numbers) here.
Description
New SYCL pipeline kernels (
t/pipelines/kernel/)Five new
*SYCL.cppfiles implement SYCL equivalents of every CUDA kernel:FeatureSYCL.cppComputeFPFHFeatureSYCLFillInLinearSystemSYCL.cppFillInRigidAlignmentTermSYCL,FillInSLACAlignmentTermSYCL,FillInSLACRegularizerTermSYCLRegistrationSYCL.cppComputePosePointToPointSYCL,ComputePosePointToPlaneSYCL,ComputeColoredICPResidualAndGradientSYCL,ComputePointToPlaneDistancesSYCLRGBDOdometrySYCL.cppTransformationConverterSYCL.cppKernels use
sycl::nd_range+sycl::reduce_over_groupfor reduction paths (matching CUDA'scub::BlockReduce) instead of plain global atomics, andsycl::local_accessorfor shared local memory.New SYCL geometry kernel (
t/geometry/kernel/)TransformSYCL.cpp— SYCL implementations ofTransformPoints,TransformNormals,RotatePoints,RotateNormalsviasycl::queue::parallel_for. Reuses the existingTransformImpl.hper-element kernels, guarded by a newOPEN3D_SKIP_TRANSFORM_MAINmacro (mirrorsOPEN3D_SKIP_FPFH_MAINinFeatureImpl.h) to avoid duplicate symbol errors.Transform.cppandTransform.hupdated withIsSYCL()dispatch branches.NNS CPU fallback for SYCL devices (
t/geometry/PointCloud.cpp,t/pipelines/registration/)NearestNeighborSearchexplicitly rejects SYCL tensors. Every NNS call site now transparently redirects to CPU whendevice.IsSYCL():Affected:
EstimateNormals(Hybrid/KNN/Radius),EstimateColorGradients(Hybrid/KNN/Radius),RemoveRadiusOutliers,RemoveStatisticalOutliers,ComputeBoundaryPoints,ComputeFPFHFeature,CorrespondencesFromFeatures,EvaluateRegistration,MultiScaleICP,GetInformationMatrix.Test coverage
All
t/pipelinestests (Registration,Feature,TransformationEstimation,RGBDOdometry,TransformationConverter, SLAC) updated to usePermuteDevicesWithSYCLso SYCL:0 is exercised in CI.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.